from TurtleWorld import *
from math import *
 
world=TurtleWorld()
Mah=Turtle()
Mah.delay= .001
 
sam=Turtle()
sam.color= "green"
sam.delay= .001
 
#----------------------------TRIANGLES----------------------------#

def equilateral_tri(t, size=100, rotate=0):
    print "Equilateral Triangle, with Size:", size, "and Rotation:", rotate
    t.lt(rotate)
    for i in range(3):
        t.fd(size)
        t.lt(120)
    t.rt(rotate)
#--------------------------QUADRILATERALS-------------------------#

def para(t, width=100, height=100, angle=120, rotate=0):
    print "Parallelogram, with Width:", width, "Height:", height, "Angle:", angle, "and Rotation:", rotate

    t.lt(rotate)
    for i in range(2):
        t.fd(width)
        t.lt(angle)
        t.fd(height)
        t.fd(width)
        t.lt(180-angle)
    t.rt(rotate)

def rhom(t, size=100, angle=120, rotate=0):
    print "Rhombus, with Size:", size, "Angle:", angle, "and Rotation:", rotate
    t.lt(rotate)
    for i in range(2):
        t.fd(size)
        t.lt(angle)
        t.fd(size)
        t.lt(180-angle)
    t.rt(rotate)
def rect(t, width=100, height=100, rotate=0):
    print "Rectangle, with Width:", width, "Height:", height, "and Rotation:", rotate
    t.lt(rotate)
    for i in range(4):
        t.fd(width)
        t.fd(height)
        t.fd(width)
    t.rt(rotate)

def square(t, size=100, rotate=0):
    print "Sqaure, with Size:", size, "and Rotation:", rotate
    t.lt(rotate)
    for i in range(4):
        t.fd(size)
        t.lt(90)
    t.rt(rotate)
#------------------------------MOVEMENT---------------------------#

def line(t, x=100, y=100):
	print "Line to a point X:", x, "over and Y:", y, "up"
	dist= sqrt(x**2+ y**2)
	angle= degrees(atan(y/float(x)))
	t.lt(angle)
	t.fd(dist)
	t.rt(angle)
  
def move(t, x, y):
	print "Move without marking to a point X:", x, "over and Y:", y, "up"
 	t.pu()
 	line(t, x, y)
 	t.pd()
#------------------------------OTHER SHAPES------------------------#
"""
Build any other shape functions you want.
Some Ideas:
	Right Triangles (sss, sas, etc)
	Arbitrary Triangles
	Circle
	Arcs
	Go Wild!
	
Bonus for working or challenging functions...no penalty for trying something
"""

#-----------------------------My shapes----------------------------#

def arc(t, size= 100):
    t.lt(90)
    for i in range(23):
        t.fd(size*3.3)
        t.rt(8)
        
def ltArc(t, size= 100):
    t.lt(90)
    for i in range(23):
        t.fd(size*3.3)
        t.lt(8)
        
def circle(t, size= 100):
    t.lt(90)
    for i in range(46):
        t.fd(size*6.6)
        t.lt(8)

      
#arc(Mah, 3)
#arc(Mah, 3)

#sam.lt(90)

#ltArc(sam, 3)

sam.pu()
sam.lt(180)
sam.pd()

#ltArc(sam, 3)

sam.pu()
sam.rt(134)
sam.pd()

Mah.pu()
Mah.rt(90)
Mah.fd(250)
Mah.pd()

#circle(Mah, 5)

equilateral_tri(sam, 300, 702,)

square(Mah, 90, 50)

rhom(sam,100, 140, 100) 

para(Mah, 100, 140, 100)

rect(sam, 50, 50)

line(sam, 100,100)

move(Mah, 100, 100)

#------------------------------TEST-------------------------------#



wait_for_user()